<template>
  <el-drawer
    v-model="props.show"
    class="jzt-drawer"
    style="padding: 0"
    :with-header="false"
    :size="props.size"
    :before-close="handelClose"
  >
    <div class="header">
      <span>{{ props.title }}</span>
      <el-icon size="20" @click="handelbeforeClose"><CloseBold /></el-icon>
    </div>
    <div class="content">
      <slot></slot>
    </div>
  </el-drawer>
</template>
<script setup>
import { defineProps, defineEmits } from "vue";
const emits = defineEmits(["close", "save"]);
const props = defineProps({
  show: {
    type: Boolean,
    default: false
  },
  title: {
    type: String,
    default: ""
  },
  size: {
    type: String,
    default: "30%"
  }
});
const handelbeforeClose = () => {
  emits("close");
};
const handelClose = () => {
  emits("close");
};
</script>
<style scoped lang="scss">
:deep(.el-drawer__body) {
  padding: 0 !important;
}
.header {
  display: flex;
  justify-content: space-between;
  height: 50px;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid #c2d4e8;
  span {
    font-size: 16px;
    position: relative;
    margin-left: 14px;
  }
  i {
    cursor: pointer;
  }
  span::before {
    content: " ";
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #409eff;
    margin-right: 10pxrgb (47, 53, 225);
  }
}
.content {
  // height: 100%;
}
</style>
